@extends('admin.layout')
@section('content')

              <section class="content-header">
                    <h1>
                        后台管理
                        <small>管理员模块</small>
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                        <li class="active">管理员模块</li>
                        <li class="active">管理员编辑</li>
                    </ol>
                </section>
            
      <!-- BEGIN MAIN CONTENT -->
      
      
      <section id="main-content">
             
    <!-- BEGIN WRAPPER  -->
        <section class="wrapper">
                     <section class="panel">
                        <header class="panel-heading">
                           <span class="label label-primary"><b>用户修改</b></span>
                           <span class="tools pull-right">
                           <a href="javascript:;" class="fa fa-chevron-down"></a>
                           <a href="javascript:;" class="fa fa-times"></a>
                           </span>
                        </header>

                           
                         @if (count($errors) > 0)
                           <div class="box-body">
                              <div class="alert alert-danger alert-dismissable">
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                <h4><i class="fa fa-warning"></i> 用户添加修改:</h4>
                        
                            
                                <ul>
                                    @foreach ($errors->all() as $error)
                                        <li>{{ $error }}</li>
                                    @endforeach
                                </ul>
                             </div>
                            </div><!-- /.box-body -->
                        @endif  

                        @if(session('info')) 

                            <div class="box-body">
                              <div class="alert alert-danger alert-dismissable">
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                <h4><i class="fa fa-warning"></i> {{ session['info'] }}!</h4>
                        @endif          

                        <div class="panel-body">
                           <form  action="/admin/user/doedit" method="post">
                            {{ csrf_field() }}
                              <div class="form-group">
                                <input type="hidden" name='id' value="{{ $data -> id }}"> 
                              </div>
                              <div class="form-group">
                                 <label for="InputUsername">用户名</label>
                                 <input class="form-control" id="InputUsername" placeholder="请输入6~18位用户名" type="text" name="username" value="{{ $data -> username }}">
                              </div>
                              <div class="form-group">
                                 <label for="InputEmail1">邮箱</label>
                                 <input class="form-control" id="InputEmail1" placeholder="请输入您常用邮箱地址" type="email" name='email' value="{{ $data -> email }}">
                              </div>
                              <div class="form-group">
                                 <label for="InputToken">密码令牌</label>
                                 <input class="form-control" id="InputUsername" placeholder="请输入token以方便找回密码" type="text" name="Token" value="{{ $data -> token }}">
                              </div>
                              <div class="form-group">
                                 <label for="InputStatus">用户状态</label>
                                 <div class="radio">
                                       <label>
                                       <input name="status" id="optionsRadios1"
                                        @if($data -> status == '0')
                                        checked="checked"
                                        @endif
                                          value="0" type="radio">
                                       禁用
                                       </label>
                                    </div>
                                    <div class="radio">
                                       <label>
                                       <input name="status" id="optionsRadios2"

                                       @if($data -> status == '1')
                                        checked="checked"
                                        @endif

                                        value="1" type="radio">
                                       启用
                                       </label>
                                    </div>
                              </div>                                   
                              <button type="submit" class="btn btn-info">修改管理员数据</button>
                           </form>
                        </div>
                     </section>
               </section>
    <!-- END WRAPPER  -->
      </section>
      <!-- END MAIN CONTENT -->
           

@endsection